﻿/*
Copyright © 2010 François Karman

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

See <license.txt> for the complete license of the software.
*/

using System.Diagnostics.CodeAnalysis;
using System.Windows;
using System.Windows.Controls;

namespace Faz.Dependencies.Controls
{
    /// <summary>
    /// Defines the container of the result visual element.
    /// </summary>
    public class DependencyViewResultItem : ListViewItem
    {
        /// <summary>
        /// Identifies the <see cref="DependencyViewResultItem.IsHorizontallySelected"/> property.
        /// </summary>
        public static readonly DependencyProperty IsHorizontallySelectedProperty =
            DependencyProperty.Register("IsHorizontallySelected", typeof(bool), typeof(DependencyViewResultItem), new UIPropertyMetadata(false));

        /// <summary>
        /// Identifies the <see cref="DependencyViewResultItem.IsVerticallySelected"/> property.
        /// </summary>
        public static readonly DependencyProperty IsVerticallySelectedProperty =
            DependencyProperty.Register("IsVerticallySelected", typeof(bool), typeof(DependencyViewResultItem), new UIPropertyMetadata(false));

        /// <summary>
        /// Initializes static members of the DependencyViewResultItem class.
        /// </summary>
        [SuppressMessage(
            "Microsoft.Performance",
            "CA1810:InitializeReferenceTypeStaticFieldsInline",
            Justification = "This static constructor is required for WPF initialization")]
        static DependencyViewResultItem()
        {
            DefaultStyleKeyProperty.OverrideMetadata(
                typeof(DependencyViewResultItem),
                new FrameworkPropertyMetadata(typeof(DependencyViewResultItem)));
        }

        /// <summary>
        /// Gets or sets a value indicating whether the element is part of a selected row.
        /// </summary>
        public bool IsHorizontallySelected
        {
            get { return (bool)GetValue(IsHorizontallySelectedProperty); }
            set { SetValue(IsHorizontallySelectedProperty, value); }
        }

        /// <summary>
        /// Gets or sets a value indicating whether the element is part of a selected column.
        /// </summary>
        public bool IsVerticallySelected
        {
            get { return (bool)GetValue(IsVerticallySelectedProperty); }
            set { SetValue(IsVerticallySelectedProperty, value); }
        }
    }
}
